package com.tool.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * 
* @author dinghao
* @ClassName: ToMacNo 
* @Description: TODO
* @date 2018年3月16日 下午2:20:06 
*
 */
public class ToMacNo {

	public static List<String> toMacNo(String socialAccount) {
		List<String> macNoList = new ArrayList<String>();
		String[] macNOs = socialAccount.split(";");
		for (int j = 0; j < macNOs.length; j++) {
			String string = macNOs[j];
			string = string.replaceAll("-", "");
			if(string.length() <= 12) {
				String macNo = "";
				int i = 1;
				char[] charArray = string.toCharArray();
				for (char c : charArray) {
					macNo+=c;
					if(i%2==0 && i<string.length()) {
						macNo+='-';
					}
					i++;
				}
				macNoList.add(macNo.toUpperCase());
			}
		}
		return macNoList;
	}
	
	public static void main(String[] args) {
//		String str = "sdfihisdf32l;2334kndkfnvk;eddncj-ni-21-9u";
//		List<String> macNoList = toMacNo(str);
//		System.out.println(macNoList);
//		ImportPersonType importPersonType = new ImportPersonType();
//		System.out.println(importPersonType);
		
//		String str = "鄂AL1 Y 05";
//		System.out.println(str.replaceAll(" ", ""));
//		System.out.println(str.length());
		
//		String str="asf#134";
//		str=str.replaceAll("[^0-9]", "1");
//		System.out.println(str);
		
		List<String> mobileList = new ArrayList<String>();
		String mobile = "丁号";
		mobile=mobile.replaceAll("[^0-9]", ";");
		String[] split = mobile.split(";");
		for (int i = 0; i < split.length; i++) {
			String string = split[i];
			if(!string.trim().isEmpty()) {
				mobileList.add(string);
			}
		}
		System.out.println(mobileList);
		
//		List<String> list = new ArrayList<String>();
//		for (String string : list) {
//			System.out.println("adas");
//			if(string == null) {
//				System.out.println("kong");
//			}
//		}
		
//		ImportSocial p = new ImportSocial();
//		p.setId("123");
//		p.setPersonId("456");
//		p.setSocialAccount("789");
//		p.setType("0");
//		System.out.println(p);
//		p = null;
//		System.out.println(p);
	}
}
